<!DOCTYPE html>





<html lang="zh-CN">
<head>
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 4.2.1">
  <link rel="apple-touch-icon" sizes="180x180" href="/sunpages/images/apple-touch-icon-next.png?v=7.4.0">
  <link rel="icon" type="image/png" sizes="32x32" href="/sunpages/images/favicon-32x32-next.png?v=7.4.0">
  <link rel="icon" type="image/png" sizes="16x16" href="/sunpages/images/favicon-16x16-next.png?v=7.4.0">
  <link rel="mask-icon" href="/sunpages/images/logo.svg?v=7.4.0" color="#222">

<link rel="stylesheet" href="/sunpages/css/main.css?v=7.4.0">


<link rel="stylesheet" href="/sunpages/lib/font-awesome/css/font-awesome.min.css?v=4.7.0">


<script id="hexo-configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/sunpages/',
    scheme: 'Pisces',
    version: '7.4.0',
    exturl: false,
    sidebar: {"position":"left","display":"post","offset":12,"onmobile":false},
    copycode: {"enable":true,"show_result":false,"style":null},
    back2top: {"enable":true,"sidebar":false,"scrollpercent":true},
    bookmark: {"enable":false,"color":"#222","save":"auto"},
    fancybox: false,
    mediumzoom: false,
    lazyload: false,
    pangu: false,
    algolia: {
      appID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    },
    localsearch: {"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},
    path: 'search.xml',
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    translation: {
      copy_button: '复制',
      copy_success: '复制成功',
      copy_failure: '复制失败'
    },
    sidebarPadding: 40
  };
</script>

  <meta name="description" content="如何配置一个顺手vim系列（一）：安装插件">
<meta property="og:type" content="article">
<meta property="og:title" content="如何配置一个顺手vim系列（一）：安装插件">
<meta property="og:url" content="https://yuandaima1.gitee.io/sunpages/2019/09/27/vim%E9%85%8D%E7%BD%AE/index.html">
<meta property="og:site_name" content="SunPages">
<meta property="og:description" content="如何配置一个顺手vim系列（一）：安装插件">
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="http://ipic-picgo.oss-cn-beijing.aliyuncs.com/2019-09-27-081607.jpg">
<meta property="article:published_time" content="2019-09-26T16:00:00.000Z">
<meta property="article:modified_time" content="2019-10-24T03:07:15.000Z">
<meta property="article:author" content="sunhanwu">
<meta property="article:tag" content="Linux">
<meta property="article:tag" content="vim">
<meta name="twitter:card" content="summary">
<meta name="twitter:image" content="http://ipic-picgo.oss-cn-beijing.aliyuncs.com/2019-09-27-081607.jpg">
  <link rel="canonical" href="https://yuandaima1.gitee.io/sunpages/2019/09/27/vim%E9%85%8D%E7%BD%AE/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome: false,
    isPost: true,
    isPage: false,
    isArchive: false
  };
</script>

  <title>如何配置一个顺手vim系列（一）：安装插件 | SunPages</title>
  








  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .logo,
  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript><!-- hexo-inject:begin --><!-- hexo-inject:end -->

</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-CN">
  <!-- hexo-inject:begin --><!-- hexo-inject:end --><div class="container use-motion">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-meta">

    <div>
      <a href="/sunpages/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">SunPages</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
        <h1 class="site-subtitle" itemprop="description">屁话少说,放码过来！</h1>
      
  </div>

  <div class="site-nav-toggle">
    <button aria-label="切换导航栏">
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>


<nav class="site-nav">
  
  <ul id="menu" class="menu">
      
      
      
        
        <li class="menu-item menu-item-home">
      
    

    <a href="/sunpages/" rel="section"><i class="menu-item-icon fa fa-fw fa-home"></i> <br>首页</a>

  </li>
      
      
      
        
        <li class="menu-item menu-item-about">
      
    

    <a href="/sunpages/about/" rel="section"><i class="menu-item-icon fa fa-fw fa-user"></i> <br>关于</a>

  </li>
      
      
      
        
        <li class="menu-item menu-item-tags">
      
    

    <a href="/sunpages/tags/" rel="section"><i class="menu-item-icon fa fa-fw fa-tags"></i> <br>标签</a>

  </li>
      
      
      
        
        <li class="menu-item menu-item-categories">
      
    

    <a href="/sunpages/categories/" rel="section"><i class="menu-item-icon fa fa-fw fa-th"></i> <br>分类</a>

  </li>
      
      
      
        
        <li class="menu-item menu-item-archives">
      
    

    <a href="/sunpages/archives/" rel="section"><i class="menu-item-icon fa fa-fw fa-archive"></i> <br>归档</a>

  </li>
      
      
      
        
        <li class="menu-item menu-item-photos">
      
    

    <a href="/sunpages/photo/" rel="section"><i class="menu-item-icon fa fa-fw fa-image"></i> <br>Photos</a>

  </li>
      <li class="menu-item menu-item-search">
        <a href="javascript:;" class="popup-trigger">
        
          <i class="menu-item-icon fa fa-search fa-fw"></i> <br>搜索</a>
      </li>
    
  </ul>

</nav>
  <div class="site-search">
    <div class="popup search-popup">
    <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input" id="search-input"></div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div class="algolia-results">
  <div id="algolia-stats"></div>
  <div id="algolia-hits"></div>
  <div id="algolia-pagination" class="algolia-pagination"></div>
</div>

  
</div>
<div class="search-pop-overlay"></div>

  </div>
</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>

  <a href="https://github.com/sunhanwu" class="github-corner" title="Follow me on GitHub" aria-label="Follow me on GitHub" rel="noopener" target="_blank"><svg width="80" height="80" viewBox="0 0 250 250" aria-hidden="true"><path d="M0,0 L115,115 L130,115 L142,142 L250,250 L250,0 Z"></path><path d="M128.3,109.0 C113.8,99.7 119.0,89.6 119.0,89.6 C122.0,82.7 120.5,78.6 120.5,78.6 C119.2,72.0 123.4,76.3 123.4,76.3 C127.3,80.9 125.5,87.3 125.5,87.3 C122.9,97.6 130.6,101.9 134.4,103.2" fill="currentColor" style="transform-origin: 130px 106px;" class="octo-arm"></path><path d="M115.0,115.0 C114.9,115.1 118.7,116.5 119.8,115.4 L133.7,101.6 C136.9,99.2 139.9,98.4 142.2,98.6 C133.8,88.0 127.5,74.4 143.8,58.0 C148.5,53.4 154.0,51.2 159.7,51.0 C160.3,49.4 163.2,43.6 171.4,40.1 C171.4,40.1 176.1,42.5 178.8,56.2 C183.1,58.6 187.2,61.8 190.9,65.4 C194.5,69.0 197.7,73.2 200.1,77.6 C213.8,80.2 216.3,84.9 216.3,84.9 C212.7,93.1 206.9,96.0 205.4,96.6 C205.1,102.4 203.0,107.8 198.3,112.5 C181.9,128.9 168.3,122.5 157.7,114.1 C157.9,116.9 156.7,120.9 152.7,124.9 L141.0,136.5 C139.8,137.7 141.6,141.9 141.8,141.8 Z" fill="currentColor" class="octo-body"></path></svg></a>


    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
            

          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
      <article itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block post">
    <link itemprop="mainEntityOfPage" href="https://yuandaima1.gitee.io/sunpages/sunpages/2019/09/27/vim%E9%85%8D%E7%BD%AE/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="sunhanwu">
      <meta itemprop="description" content="Talk is cheap, show me the code!">
      <meta itemprop="image" content="http://ipic-picgo.oss-cn-beijing.aliyuncs.com/2019-09-12-logo.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="SunPages">
    </span>
      <header class="post-header">
        <h2 class="post-title" itemprop="name headline">如何配置一个顺手vim系列（一）：安装插件

          
        </h2>

        <div class="post-meta">
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              
                
              

              <time title="创建时间：2019-09-27 00:00:00" itemprop="dateCreated datePublished" datetime="2019-09-27T00:00:00+08:00">2019-09-27</time>
            </span>
          
            

            
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="fa fa-calendar-check-o"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2019-10-24 11:07:15" itemprop="dateModified" datetime="2019-10-24T11:07:15+08:00">2019-10-24</time>
              </span>
            
          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing"><a href="/sunpages/categories/tools/" itemprop="url" rel="index"><span itemprop="name">tools</span></a></span>

                
                
              
            </span>
          

          
  
  <span class="post-meta-item">
    
      <span class="post-meta-item-icon">
        <i class="fa fa-comment-o"></i>
      </span>
        
      
      <span class="post-meta-item-text">Valine：</span>
    
    <a title="valine" href="/sunpages/2019/09/27/vim%E9%85%8D%E7%BD%AE/#comments" itemprop="discussionUrl"><span class="post-comments-count valine-comment-count" data-xid="/sunpages/2019/09/27/vim%E9%85%8D%E7%BD%AE/" itemprop="commentCount"></span></a>
  </span>
  
  
          <br>
            <span class="post-meta-item" title="本文字数">
              <span class="post-meta-item-icon">
                <i class="fa fa-file-word-o"></i>
              </span>
              
                <span class="post-meta-item-text">本文字数：</span>
              
              <span>4.3k</span>
            </span>
          
            <span class="post-meta-item" title="阅读时长">
              <span class="post-meta-item-icon">
                <i class="fa fa-clock-o"></i>
              </span>
              
                <span class="post-meta-item-text">阅读时长 &asymp;</span>
              
              <span>4 分钟</span>
            </span>
          

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h1 id="如何配置一个顺手vim系列（一）：安装插件"><a href="#如何配置一个顺手vim系列（一）：安装插件" class="headerlink" title="如何配置一个顺手vim系列（一）：安装插件"></a>如何配置一个顺手vim系列（一）：安装插件</h1><a id="more"></a><blockquote>
<p>个人由于在服务器上进行科研和开发工作，所以使用vim比较多，这里简单记录一下自己配置vim的过程</p>
</blockquote>
<p>对于任何一个Linux玩家来说，vim都不可避免，其许多看似反人类的设计，其实背后都有原因。虽然前期的学习曲线比较高，但是一旦使用熟练之后，其开发和编辑的效率完全能和各种现代的编辑器媲美甚至更胜一筹，并且由于其打开速度快，线上开发方便等优点而深受程序员喜爱，下面就结合我自己的vim配置介绍一下。</p>
<h2 id="一、安装插件管理器-vim-plug"><a href="#一、安装插件管理器-vim-plug" class="headerlink" title="一、安装插件管理器:vim-plug"></a>一、安装插件管理器:vim-plug</h2><p>vim-plug是一款优秀的插件管理器，其安装十分简单,命令如下:</p>
<figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line">curl -fLo ~/.vim/<span class="built_in">autoload</span>/plug.vim --create-dirs \</span><br><span class="line">    https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim</span><br></pre></td></tr></table></figure>
<h2 id="二、安装插件"><a href="#二、安装插件" class="headerlink" title="二、安装插件"></a>二、安装插件</h2><p>在home目录下的.vimrc文件中添加如下配置：</p>
<figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br><span class="line">52</span><br><span class="line">53</span><br><span class="line">54</span><br><span class="line">55</span><br><span class="line">56</span><br><span class="line">57</span><br><span class="line">58</span><br><span class="line">59</span><br><span class="line">60</span><br><span class="line">61</span><br><span class="line">62</span><br><span class="line">63</span><br><span class="line">64</span><br><span class="line">65</span><br><span class="line">66</span><br><span class="line">67</span><br><span class="line">68</span><br><span class="line">69</span><br><span class="line">70</span><br><span class="line">71</span><br><span class="line">72</span><br><span class="line">73</span><br><span class="line">74</span><br><span class="line">75</span><br><span class="line">76</span><br><span class="line">77</span><br><span class="line">78</span><br><span class="line">79</span><br><span class="line">80</span><br><span class="line">81</span><br><span class="line">82</span><br><span class="line">83</span><br><span class="line">84</span><br><span class="line">85</span><br><span class="line">86</span><br><span class="line">87</span><br><span class="line">88</span><br><span class="line">89</span><br><span class="line">90</span><br><span class="line">91</span><br><span class="line">92</span><br></pre></td><td class="code"><pre><span class="line">set nocompatible              <span class="string">" be iMproved, required</span></span><br><span class="line"><span class="string">filetype off                  "</span> required</span><br><span class="line">set backspace=<span class="number">2</span></span><br><span class="line"></span><br><span class="line"><span class="string">" 插件管理</span></span><br><span class="line"><span class="string">set rtp+=~/.vim/bundle/Vundle.vim</span></span><br><span class="line"><span class="string">call plug#begin()</span></span><br><span class="line"><span class="string">"</span> Plug <span class="string">'VundleVim/Vundle.vim'</span></span><br><span class="line">Plug <span class="string">'python-mode/python-mode'</span>, &#123; <span class="string">'branch'</span>: <span class="string">'develop'</span> &#125;</span><br><span class="line"><span class="string">" Plug 'davidhalter/jedi-vim'</span></span><br><span class="line"><span class="string">Plug 'tpope/vim-surround'</span></span><br><span class="line"><span class="string">Plug 'majutsushi/tagbar'</span></span><br><span class="line"><span class="string">"</span> Plug <span class="string">'w0rp/ale'</span></span><br><span class="line">Plug <span class="string">'mhinz/vim-startify'</span></span><br><span class="line">Plug <span class="string">'ervandew/supertab'</span></span><br><span class="line">Plug <span class="string">'python-mode/python-mode'</span></span><br><span class="line">Plug <span class="string">'scrooloose/nerdcommenter'</span></span><br><span class="line">Plug <span class="string">'kien/ctrlp.vim'</span></span><br><span class="line">Plug <span class="string">'scrooloose/nerdtree'</span></span><br><span class="line">Plug <span class="string">'vim-scripts/taglist.vim'</span></span><br><span class="line">Plug <span class="string">'vim-scripts/The-NERD-Commenter'</span></span><br><span class="line"><span class="string">" Plug 'junegunn/vim-easy-align'</span></span><br><span class="line"><span class="string">Plug 'easymotion/vim-easymotion'</span></span><br><span class="line"><span class="string">Plug 'vim-scripts/winmanager'</span></span><br><span class="line"><span class="string">Plug 'tomasr/molokai'</span></span><br><span class="line"><span class="string">Plug 'vim-airline/vim-airline'</span></span><br><span class="line"><span class="string">Plug 'vim-airline/vim-airline-themes'</span></span><br><span class="line"><span class="string">Plug 'Yggdroot/indentLine'</span></span><br><span class="line"><span class="string">Plug 'Xuyuanp/nerdtree-git-plugin'</span></span><br><span class="line"><span class="string">Plug 'sbdchd/neoformat'</span></span><br><span class="line"><span class="string">"</span> Plug <span class="string">'Chiel92/vim-autoformat'</span></span><br><span class="line"><span class="string">" Plug 'lyokha/vim-xkbswitch'</span></span><br><span class="line"><span class="string">call plug#end()            "</span> required</span><br><span class="line">filetype plugin indent on    <span class="string">" required</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">"</span>基础配置</span><br><span class="line">let mapleader=<span class="string">','</span></span><br><span class="line">let g:indentLine_enabled = <span class="number">1</span></span><br><span class="line">color desert <span class="string">"颜色设置</span></span><br><span class="line"><span class="string">syntax on "</span>语法高亮</span><br><span class="line">set number <span class="string">"自动显示行号</span></span><br><span class="line"><span class="string">set cursorline "</span>突出显示当前行</span><br><span class="line">set ts=<span class="number">4</span> <span class="string">"设置tab长度为4</span></span><br><span class="line"><span class="string">set shiftwidth=4 "</span>设定 &lt;&lt; 和 &gt;&gt; 命令移动时的宽度为 <span class="number">4</span></span><br><span class="line"></span><br><span class="line"><span class="string">"解决中文编码乱码</span></span><br><span class="line"><span class="string">let &amp;termencoding=&amp;encoding</span></span><br><span class="line"><span class="string">set fileencodings=utf-8,gbk</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">	</span></span><br><span class="line"><span class="string">let g:NERDSpaceDelims=1     "</span> 注释后面自动加空格<span class="string">"</span></span><br><span class="line"><span class="string">set clipboard=unnamed</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">"</span> python-mode 配置</span><br><span class="line">let g:pymode_python = <span class="string">'python3'</span> <span class="string">"设置pyhton3模式</span></span><br><span class="line"><span class="string">let g:pymode_trim_withespaces = 1 "</span> 保存是删除多于空格</span><br><span class="line">let g:pymode_doc = <span class="number">0</span> <span class="string">"</span></span><br><span class="line"><span class="string">"</span> let g:pymode_doc_bind  = <span class="string">'K'</span>  <span class="string">"</span></span><br><span class="line"><span class="string">"</span> let g:pymode_rope_completion = <span class="number">1</span></span><br><span class="line"><span class="string">" let g:pymode_rope_complete_on_dot = 1</span></span><br><span class="line"><span class="string">"</span> let g:pymode_rope_completion_bind = <span class="string">'&lt;C-Tab&gt;'</span></span><br><span class="line"><span class="string">" let g:pymode_indent = 1 时候用pep8风格的缩进</span></span><br><span class="line"><span class="string">let g:pymode_folding = 1</span></span><br><span class="line"><span class="string">let g:pymode_run_bind = '&lt;leader&gt;r'</span></span><br><span class="line"><span class="string">"</span> let g:pymode_motion = <span class="number">1</span></span><br><span class="line">let g:pymode_rope_goto_definition_bind = <span class="string">"&lt;C-]&gt;"</span></span><br><span class="line">let g:pymode_options_max_line_length = <span class="number">140</span></span><br><span class="line"><span class="string">" let g:pymode_lint_on_write = 1</span></span><br><span class="line"><span class="string">"</span> let g:pymode_lint_checkers = [<span class="string">'pyflakes'</span>,<span class="string">'pep8'</span>]</span><br><span class="line">let g:pymode_rope_completion = <span class="number">1</span></span><br><span class="line">let g:pymode_rope_complete_on_dot = <span class="number">1</span></span><br><span class="line">let g:pymode_rope_completion_bind = <span class="string">'&lt;C-Tab&gt;'</span></span><br><span class="line"><span class="string">" let g:pymode_lint_error_symbol = 'EE'</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">"</span> nerdtree配置</span><br><span class="line">nmap ,v :NERDTreeFind&lt;cr&gt;</span><br><span class="line">nmap ,g :NERDTreeToggle&lt;cr&gt;</span><br><span class="line">let NERDTreeShowHidden=<span class="number">1</span></span><br><span class="line">let NERDTreeIgnore = [</span><br><span class="line">            \ <span class="string">'\.git$'</span>, <span class="string">'\.hg$'</span>, <span class="string">'\.svn$'</span>, <span class="string">'\.stversions$'</span>, <span class="string">'\.pyc$'</span>, <span class="string">'\.pyo$'</span>, <span class="string">'\.svn$'</span>, <span class="string">'\.swp$'</span>,</span><br><span class="line">            \ <span class="string">'\.DS_Store$'</span>, <span class="string">'\.sass-cache$'</span>, <span class="string">'__pycache__$'</span>, <span class="string">'\.egg-info$'</span>, <span class="string">'\.ropeproject$'</span>,</span><br><span class="line">            \ ]</span><br><span class="line"></span><br><span class="line"></span><br><span class="line">nnoremap &lt;leader&gt;t : TagbarToggle&lt;CR&gt;</span><br><span class="line"><span class="string">" ale 配置</span></span><br><span class="line"><span class="string">let g:ale_sign_error = '✗'</span></span><br><span class="line"><span class="string">let g:ale_linters = &#123;'python': []&#125;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">"</span>easy-align配置</span><br><span class="line"><span class="string">" xmap ga &lt;Plug&gt;(EasyAlign)</span></span><br><span class="line"><span class="string">"</span> nmap ga &lt;Plug&gt;(EasyAlign)</span><br></pre></td></tr></table></figure>
<p>之后在vim中运行<code>:PlugInstalll</code>即可</p>
<p><div align="center"><img src="http://ipic-picgo.oss-cn-beijing.aliyuncs.com/2019-09-27-081607.jpg" width="400"></div></p>
<h2 id="三、插件介绍与配置"><a href="#三、插件介绍与配置" class="headerlink" title="三、插件介绍与配置"></a>三、插件介绍与配置</h2><h3 id="3-1-pyhton开发神器：python-mode"><a href="#3-1-pyhton开发神器：python-mode" class="headerlink" title="3.1 pyhton开发神器：python-mode"></a>3.1 pyhton开发神器：python-mode</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line"><span class="string">" python-mode 配置</span></span><br><span class="line"><span class="string"> let g:pymode_python = 'python3' "</span>设置pyhton3模式</span><br><span class="line"> let g:pymode_trim_withespaces = <span class="number">1</span> <span class="string">" 保存是删除多于空格</span></span><br><span class="line"><span class="string"> "</span> let g:pymode_doc = <span class="number">0</span> <span class="string">"</span></span><br><span class="line"><span class="string"> "</span> let g:pymode_doc_bind  = <span class="string">'K'</span>  <span class="string">"</span></span><br><span class="line"><span class="string">let g:pymode_rope_completion = 1</span></span><br><span class="line"><span class="string">let g:pymode_rope_complete_on_dot = 0</span></span><br><span class="line"><span class="string">let g:pymode_rope_completion_bind = '&lt;C-Tab&gt;'</span></span><br><span class="line"><span class="string">"</span> <span class="string">" let g:pymode_indent = 1 时候用pep8风格的缩进</span></span><br><span class="line"><span class="string">"</span> <span class="string">" let g:pymode_motion = 1</span></span><br><span class="line"><span class="string"> let g:pymode_lint = 1</span></span><br><span class="line"><span class="string"> let g:pymode_rope_goto_definition_bind = "</span>&lt;C-]&gt;<span class="string">"</span></span><br><span class="line"><span class="string"> let g:pymode_options_max_line_length = 120</span></span><br><span class="line"><span class="string">"</span> <span class="string">" let g:pymode_lint_on_write = 0</span></span><br><span class="line"><span class="string"> let g:pymode_lint_checkers = ['pyflakes','pep8']</span></span><br><span class="line"><span class="string"> let g:pymode_folding = 1</span></span><br></pre></td></tr></table></figure>
<p>上面的配置是python-mode中的一些配置，包括补全，缩进，折叠</p>
<p>折叠相关快捷键：</p>
<div class="table-container">
<table>
<thead>
<tr>
<th style="text-align:center">快捷键</th>
<th style="text-align:center">作用</th>
</tr>
</thead>
<tbody>
<tr>
<td style="text-align:center">zo</td>
<td style="text-align:center">展开当前函数</td>
</tr>
<tr>
<td style="text-align:center">zc</td>
<td style="text-align:center">折叠当前函数</td>
</tr>
<tr>
<td style="text-align:center">zn</td>
<td style="text-align:center">展开所有函数</td>
</tr>
<tr>
<td style="text-align:center">zN</td>
<td style="text-align:center">折叠所有函数</td>
</tr>
</tbody>
</table>
</div>
<h3 id="3-2-文件管理插件：Nerd-tree"><a href="#3-2-文件管理插件：Nerd-tree" class="headerlink" title="3.2 文件管理插件：Nerd-tree"></a>3.2 文件管理插件：Nerd-tree</h3><figure class="highlight python"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"> <span class="string">" nerdtree配置</span></span><br><span class="line"><span class="string"> nmap ,v :NERDTreeFind&lt;cr&gt;</span></span><br><span class="line"><span class="string"> nmap ,g :NERDTreeToggle&lt;cr&gt;</span></span><br><span class="line"><span class="string"> let NERDTreeShowHidden=1</span></span><br><span class="line"><span class="string">let NERDTreeIgnore = [</span></span><br><span class="line"><span class="string">            \ '\.git$', '\.hg$', '\.svn$', '\.stversions$', '\.pyc$', '\.pyo$', '\.svn$', '\.swp$',</span></span><br><span class="line"><span class="string">            \ '\.DS_Store$', '\.sass-cache$', '__pycache__$', '\.egg-info$', '\.ropeproject$',</span></span><br><span class="line"><span class="string">            \ ]</span></span><br></pre></td></tr></table></figure>

    </div>

    
    
    
        
      
        <div id="reward-container">
  <div></div>
  <button id="reward-button" disable="enable" onclick="var qr = document.getElementById(&quot;qr&quot;); qr.style.display = (qr.style.display === 'none') ? 'block' : 'none';">
    打赏
  </button>
  <div id="qr" style="display: none;">
        
      
      <div style="display: inline-block">
        <img src="https://ipic-picgo.oss-cn-beijing.aliyuncs.com/20200705000845.png" alt="sunhanwu 支付宝">
        <p>支付宝</p>
      </div>

  </div>
</div>

      

      <footer class="post-footer">
          
            
          
          <div class="post-tags">
            
              <a href="/sunpages/tags/Linux/" rel="tag"># Linux</a>
            
              <a href="/sunpages/tags/vim/" rel="tag"># vim</a>
            
          </div>
        

        

          <div class="post-nav">
            <div class="post-nav-next post-nav-item">
              
                <a href="/sunpages/2019/09/20/18tmc3/" rel="next" title="论文复现实验思路-数据预处理（二）">
                  <i class="fa fa-chevron-left"></i> 论文复现实验思路-数据预处理（二）
                </a>
              
            </div>

            <span class="post-nav-divider"></span>

            <div class="post-nav-prev post-nav-item">
              
                <a href="/sunpages/2020/02/13/vim-learn1/" rel="prev" title="vim 新手入门教程之增删改查">
                  vim 新手入门教程之增删改查 <i class="fa fa-chevron-right"></i>
                </a>
              
            </div>
          </div>
        
      </footer>
    
  </div>
  
  
  
  </article>

  </div>


          </div>
          
    
    <div class="comments" id="comments"></div>
  

        </div>
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">
        
        
        
        
      

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#如何配置一个顺手vim系列（一）：安装插件"><span class="nav-number">1.</span> <span class="nav-text">如何配置一个顺手vim系列（一）：安装插件</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#一、安装插件管理器-vim-plug"><span class="nav-number">1.1.</span> <span class="nav-text">一、安装插件管理器:vim-plug</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#二、安装插件"><span class="nav-number">1.2.</span> <span class="nav-text">二、安装插件</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#三、插件介绍与配置"><span class="nav-number">1.3.</span> <span class="nav-text">三、插件介绍与配置</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#3-1-pyhton开发神器：python-mode"><span class="nav-number">1.3.1.</span> <span class="nav-text">3.1 pyhton开发神器：python-mode</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3-2-文件管理插件：Nerd-tree"><span class="nav-number">1.3.2.</span> <span class="nav-text">3.2 文件管理插件：Nerd-tree</span></a></li></ol></li></ol></li></ol></div>
        
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image"
      src="http://ipic-picgo.oss-cn-beijing.aliyuncs.com/2019-09-12-logo.jpg"
      alt="sunhanwu">
  <p class="site-author-name" itemprop="name">sunhanwu</p>
  <div class="site-description" itemprop="description">Talk is cheap, show me the code!</div>
</div>
  <nav class="site-state motion-element">
      <div class="site-state-item site-state-posts">
        
          <a href="/sunpages/archives/%20%7C%7C%20archive">
        
          <span class="site-state-item-count">29</span>
          <span class="site-state-item-name">博客</span>
        </a>
      </div>
    
      
      
      <div class="site-state-item site-state-categories">
        
          
            <a href="/sunpages/categories/%20%7C%7C%20th">
          
        
        <span class="site-state-item-count">7</span>
        <span class="site-state-item-name">分类</span>
        </a>
      </div>
    
      
      
      <div class="site-state-item site-state-tags">
        
          
            <a href="/sunpages/tags/%20%7C%7C%20tags">
          
        
        <span class="site-state-item-count">18</span>
        <span class="site-state-item-name">标签</span>
        </a>
      </div>
    
  </nav>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="https://github.com/sunhanwu" title="GitHub &rarr; https://github.com/sunhanwu" rel="noopener" target="_blank"><i class="fa fa-fw fa-github"></i>GitHub</a>
      </span>
    
      <span class="links-of-author-item">
      
      
        
      
      
        
      
        <a href="mailto:1965190613@qq.com" title="E-Mail &rarr; mailto:1965190613@qq.com" rel="noopener" target="_blank"><i class="fa fa-fw fa-envelope"></i>E-Mail</a>
      </span>
    
  </div>


  <div class="links-of-blogroll motion-element">
    <div class="links-of-blogroll-title">
      <i class="fa fa-fw fa-link"></i>
      Links
    </div>
    <ul class="links-of-blogroll-list">
        <li class="links-of-blogroll-item">
          <a href="https://jackyanghc.github.io/" title="https://jackyanghc.github.io/" rel="noopener" target="_blank">Jackyanghc</a>
        </li>
      
        <li class="links-of-blogroll-item">
          <a href="https://michel-liu.github.io/" title="https://michel-liu.github.io/" rel="noopener" target="_blank">Michel</a>
        </li>
      
        <li class="links-of-blogroll-item">
          <a href="https://www.cnblogs.com/morwing/" title="https://www.cnblogs.com/morwing/" rel="noopener" target="_blank">morwing</a>
        </li>
      
    </ul>
  </div>

      </div>

    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2020</span>
  <span class="with-love" id="animate">
    <i class="fa fa-user"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">sunhanwu</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-area-chart"></i>
    </span>
      <span class="post-meta-item-text">站点总字数：</span>
    
    <span title="站点总字数">161k</span>
    <span class="post-meta-divider">|</span>
    <span class="post-meta-item-icon">
      <i class="fa fa-coffee"></i>
    </span>
      <span class="post-meta-item-text">站点阅读时长 &asymp;</span>
    
    <span title="站点阅读时长">2:26</span>
</div>
  <div class="theme-info">主题 – <a href="https://theme-next.org" class="theme-link" rel="noopener" target="_blank">NexT.Pisces</a> v7.4.0</div>

        












        
      </div>
    </footer>
  </div>

  


  <script src="/sunpages/lib/anime.min.js?v=3.1.0"></script>
  <script src="/sunpages/lib/velocity/velocity.min.js?v=1.2.1"></script>
  <script src="/sunpages/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

<script src="/sunpages/js/utils.js?v=7.4.0.js"></script>

<script src="/sunpages/js/motion.js?v=7.4.0.js"></script>


<script src="/sunpages/js/schemes/pisces.js?v=7.4.0.js"></script>


<script src="/sunpages/js/next-boot.js?v=7.4.0.js"></script>




  
  <script>
    (function(){
      var bp = document.createElement('script');
      var curProtocol = window.location.protocol.split(':')[0];
      bp.src = (curProtocol === 'https') ? 'https://zz.bdstatic.com/linksubmit/push.js' : 'http://push.zhanzhang.baidu.com/push.js';
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(bp, s);
    })();
  </script>








  
<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/instantsearch.js@2/dist/instantsearch.min.css">
<script src="//cdn.jsdelivr.net/npm/instantsearch.js@2/dist/instantsearch.min.js"></script>
<script src="/sunpages/js/algolia-search.js?v=7.4.0.js"></script>
















  

  

  

  


<script>
NexT.utils.getScript('//unpkg.com/valine/dist/Valine.min.js', () => {
  var GUEST = ['nick', 'mail', 'link'];
  var guest = 'nick,mail,link';
  guest = guest.split(',').filter(item => {
    return GUEST.includes(item);
  });
  new Valine({
    el: '#comments',
    verify: false,
    notify: false,
    appId: 'ToSqcWxrMe4Fx1bTFKjHnFQn-gzGzoHsz',
    appKey: 'WIlMiWIudPsl2Q2PsMVfiUUH',
    placeholder: 'Just go go',
    avatar: 'mm',
    meta: guest,
    pageSize: '10' || 10,
    visitor: false,
    lang: '' || 'zh-cn',
    path: location.pathname
  });
}, window.Valine);
</script><!-- hexo-inject:begin --><!-- Begin: Injected MathJax -->
<script type="text/x-mathjax-config">
  MathJax.Hub.Config("");
</script>

<script type="text/x-mathjax-config">
  MathJax.Hub.Queue(function() {
    var all = MathJax.Hub.getAllJax(), i;
    for(i=0; i < all.length; i += 1) {
      all[i].SourceElement().parentNode.className += ' has-jax';
    }
  });
</script>

<script type="text/javascript" src="">
</script>
<!-- End: Injected MathJax -->
<!-- hexo-inject:end -->

</body>
</html>
